package com.sscaipiao.android.activity.ShuangSeQiu;

import java.util.HashMap;
import java.util.Map;

import android.os.Bundle;
import android.util.Log;
import android.widget.SimpleAdapter;

import com.sscaipiao.android.R;
import com.sscaipiao.android.activity.Base.NormalHistoryActivity;
import com.sscaipiao.android.common.Constants;

public class DoubleColorBallHisActivity extends NormalHistoryActivity {

	String[] mFrom = new String[]{"double_color_ball_his_text1",
			"double_color_ball_his_text2",
			"double_color_ball_his_text3",
			"double_color_ball_his_text4"};

	int[] mTo = new int[]{
			R.id.double_color_ball_his_text1,
			R.id.double_color_ball_his_text2,
			R.id.double_color_ball_his_text3,
			R.id.double_color_ball_his_text4
	};
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setTitleText("双色球");
		setupHistory(getIntent(), "ssq");
		setupListData();
		SimpleAdapter mAdapter = new SimpleAdapter(this, mList,
				R.layout.double_color_ball_his_item,
				mFrom, mTo);
		setHistoryListAdapter(mAdapter);
	}

	private void setupListData() {
		if (history != null) {
			Map<String, Object> mMap = null;
			Log.v("history", history.size() + "");
			for (int j = 0; j < history.size(); j++) {
				mMap = new HashMap<String, Object>();
				String[] split = history.get(j).split(Constants.STRING_SPLITE_COMPLEX);
				mMap.put("double_color_ball_his_text1", "第" + split[0] + "期 :");
				mMap.put("double_color_ball_his_text2", split[3]);
				mMap.put("double_color_ball_his_text3", split[1]);
				mMap.put("double_color_ball_his_text4", split[2]);
				mList.add(mMap);
			}
		}
	}



}
